package com.comando.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * CommentT entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "comment_t", catalog = "qunar")
public class CommentT implements java.io.Serializable {

	// Fields

	private Long commentId;
	private UserT userT;
	private ArticleT articleT;
	private String title;
	private String commentContent;
	private Timestamp createTime;
	private String ip;
	private String state;

	// Constructors

	/** default constructor */
	public CommentT() {
	}

	/** minimal constructor */
	public CommentT(UserT userT, String state) {
		this.userT = userT;
		this.state = state;
	}

	/** full constructor */
	public CommentT(UserT userT, ArticleT articleT, String title,
			String commentContent, Timestamp createTime, String ip, String state) {
		this.userT = userT;
		this.articleT = articleT;
		this.title = title;
		this.commentContent = commentContent;
		this.createTime = createTime;
		this.ip = ip;
		this.state = state;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "COMMENT_ID", unique = true, nullable = false)
	public Long getCommentId() {
		return this.commentId;
	}

	public void setCommentId(Long commentId) {
		this.commentId = commentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public UserT getUserT() {
		return this.userT;
	}

	public void setUserT(UserT userT) {
		this.userT = userT;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ARTICLE_ID")
	public ArticleT getArticleT() {
		return this.articleT;
	}

	public void setArticleT(ArticleT articleT) {
		this.articleT = articleT;
	}

	@Column(name = "TITLE", length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "COMMENT_CONTENT")
	public String getCommentContent() {
		return this.commentContent;
	}

	public void setCommentContent(String commentContent) {
		this.commentContent = commentContent;
	}

	@Column(name = "CREATE_TIME", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "IP", length = 50)
	public String getIp() {
		return this.ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	@Column(name = "STATE", nullable = false, length = 2)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

}